/*
 * Copyright (c) 2017. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

package com.mrd.gtimpframe.action;

import com.mrd.util.LoginUtil;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by dengdc on 2017/11/1.
 */
@Controller
@RequestMapping("/business/fr/")
public class FrController {
    @Value("${fr.server.url}")
    private String frUrl;
    @Value("${fr.reportlet.customerBizSummary}")
    private String customerBizSummaryReportlet;
    @Value("${fr.reportlet.customerBiz}")
    private String customerBizReportlet;
    @Value("${fr.reportlet.customerFundFlow}")
    private String customerFundFlowReportlet;
    @Value("${fr.reportlet.supplierBizSummary}")
    private String supplierBizSummaryReportlet;
    @Value("${fr.reportlet.supplierBiz}")
    private String supplierBizReportlet;
    @Value("${fr.reportlet.platformCustomerBizSummary}")
    private String platformCustBizSummaryReportlet;
    @Value("${fr.reportlet.platformSupplierBizSummary}")
    private String platformSupBizSummaryReportlet;
    @Value("${fr.reportlet.platformBiz}")
    private String platformBizReportlet;
    @Value("${fr.reportlet.platformFundFlow}")
    private String platformFlowReportlet;
    @Value("${fr.reportlet.platformCustomerFinancialSummary}")
    private String platformCustomerFinancialSummary;
    @Value("${fr.reportlet.platformOrderForSummary}")
    private String platformOrderForSummary;

    /**
     * 客户业务汇总表
     */
    @RequestMapping("customerBizSummary")
    public String customerBizSummary(){
        String comId = LoginUtil.getLoginUser().getCompany().getId();
        return "redirect:" + frUrl + customerBizSummaryReportlet  + comId;
    }

    /**
     * 客户业务详情表
     */
    @RequestMapping("customerBiz")
    public String customerBiz(){
        String comId = LoginUtil.getLoginUser().getCompany().getId();
        return "redirect:" + frUrl + customerBizReportlet + comId;
    }

    /**
     * 客户资金流水表
     */
    @RequestMapping("customerFundFlow")
    public String customerFundFlow(){
        String comId = LoginUtil.getLoginUser().getCompany().getId();
        return "redirect:" + frUrl + customerFundFlowReportlet + comId;
    }

    /**
     * 供应商业务汇总表
     */
    @RequestMapping("supplierBizSummary")
    public String supplierBizSummary(){
        String comId = LoginUtil.getLoginUser().getCompany().getId();
        return "redirect:" + frUrl + supplierBizSummaryReportlet + comId;
    }

    /**
     * 供应商业务详情表
     */
    @RequestMapping("supplierBiz")
    public String supplierBiz(){
        String comId = LoginUtil.getLoginUser().getCompany().getId();
        return "redirect:" + frUrl + supplierBizReportlet + comId;
    }

    /**
     * 平台管理-业务详情表
     */
    @RequestMapping("platformBiz")
    public String platformBiz(){
        return "redirect:" + frUrl + platformBizReportlet;
    }

    /**
     * 平台管理-客户业务汇总
     */
    @RequestMapping("platformCustBizSummary")
    public String platformCustBizSummary(){
        return "redirect:" + frUrl + platformCustBizSummaryReportlet;
    }

    /**
     * 平台管理-供应商业务汇总
     */
    @RequestMapping("platformSupBizSummary")
    public String platformSupBizSummary(){
        return "redirect:" + frUrl + platformSupBizSummaryReportlet;
    }

    /**
     * 平台管理-资金流水
     */
    @RequestMapping("platformFundFlow")
    public String platformFundFlow(){
        return "redirect:" + frUrl + platformFlowReportlet;
    }

    /**
     * 平台管理-客户财务汇总表
     */
    @RequestMapping("platformCustomerFinancialSummary")
    public String platformCustomerFinancialSummary(){
        return "redirect:" + frUrl + platformCustomerFinancialSummary;
    }

    /**
     * 平台管理-代录单情况汇总表
     */
    @RequestMapping("platformOrderForSummary")
    public String platformOrderForSummary(){
        return "redirect:" + frUrl + platformOrderForSummary;
    }
}
